<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="file:///android_asset/lemon/css/friends_detail.css" />
<link rel="stylesheet" type="text/css" href="file:///android_asset/lemon/css/constants.css" />
<script type="text/javascript" src="file:///android_asset/lemon/js/jquery.min.js" />
<script type="text/javascript" src="file:///android_asset/lemon/js/constants.js" />
<script type="text/javascript" src="file:///android_asset/lemon/js/friends_detail.js" />
<script type="text/javascript">
var server_address = window.lemon.js2client(4,null);
var _id =  window.lemon.js2client(3,null);
var nick_name = window.lemon.httpGet(server_address+"/tom/servlet/C2S2returnFriends?cmd=3&_id="+_id);
</script>
</head>

<body>

<div id='head'>
<script type="text/javascript">
document.write("<h3 id='head' align='center'>"+nick_name+"</h3>");
</script>
</div>
<div>
<script type="text/javascript">
stuff_img = window.lemon.httpGet(server_address+"/tom/servlet/C2S4saveandreturnImage?_id="+_id);
var img = "<img src='"+stuff_img+"' width='110' height='150' id='stuff' style='float:left' />";
document.write(img);
</script>
<div id="content">
<script type="text/javascript">
var data2 = window.lemon.httpGet(server_address+"/tom/servlet/C2S3returnStory?my_story=my_story&user_id="+_id);
document.write("<p id='my_story' >"+data2+"</p>");
</script>
</div>
<div class="clear"></div>
</div>

<br>
<script type="text/javascript">
document.write("<div class='pro'>");
var pro =  window.lemon.httpGet(server_address+"/tom/servlet/C2S10professional?user_id="+_id+"&cmd=read");
var pro1 = new String(pro);
if(pro1 == "nobody"){
	document.write("<img src='file:///android_asset/lemon/res/professional.png' width='64' height='64' type='button' id='professional'></img>");
}else{
	var img_path= "<img alt='"+pro1+"' src='file:///android_asset/lemon/res/"+pro1+".jpg' width='69' height='72' id='"+pro1+"' />";
	document.write("<div id='pro_div'>");
	document.write(img_path);
	document.write("</div>");
}

document.write("</div>");
</script>


<script type="text/javascript">
//document.write("<br>");
//document.write("<hr width='220' align='left' size=1 color=#9d9d9d style='FILTER: alpha(opacity=80,finishopacity=30);left:0px;'>");
document.write("<div id='reply'>");
document.write("<div id='head'>");
document.write("<h3 id='head' align='center'>先点旁边的+，成为他/她的好友，留言才会生效。</h3>");
document.write("</div>");
document.write("<h1>留言本</h1>");
var data = window.lemon.httpGet(server_address+"/tom/servlet/C2S5reply?cmd=2&user_id="+_id);
var str1 = new String(data);
var reply_index = new Array();
reply_index = str1.split(",");

var data = window.lemon.httpGet(server_address+"/tom/servlet/C2S5reply?time=&user_id="+_id);
var str1 = new String(data);
var reply_time = new Array();
reply_time = str1.split(",");
for(var k = 0; k < reply_index.length - 1; k++){
	reply_time[k] = reply_time[k].replace(/(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+).(\d+)/,"$2月$3日 $4点$5分");
	var reply_every = new String(reply_index[k]);
	var reply_id =  reply_every.replace(/(\d+):>(.*)/,"$1");
	var reply_content = reply_every.replace(/(\d+):>(.*)/,"$2");
	reply_every = "<div id='"+reply_id+"' class='reply'><img style='float:left' src='"+server_address + "/tom/res/img/"+reply_id+".jpg' width='80' height='120' id='"+reply_id+"' /><p id='content'>"+reply_content+"<br><br><small>"+reply_time[k]+"</small></p></div>";
	
	document.write(reply_every);
}
document.write("</div>");
//document.write("<hr width='220' align='left' size=1 color=#9d9d9d style='FILTER: alpha(opacity=80,finishopacity=30);left:0px;'>");
document.write("<h3>Fans</h3>");
var data = window.lemon.httpGet(server_address+"/tom/servlet/C2S2returnFriends?cmd=1&user_id="+user_id+"&_id="+_id+"&goto=goto");
var str1 = new String(data);
var str2 = str1.slice(9,str1.length);
var str3 = str2.substring(0,str2.indexOf("}"));
friends_index = str3.split(",");
document.write("<div id='mark'>");
var j = "";
for(var i = friends_index.length -1,j = 0; i >= 0;j++, i--){
	if(j > 5){
		break;
	}
	var img_contact = "<img src='"+server_address + "/tom/res/img/"+friends_index[i]+".jpg' width='80' height='120' id='"+friends_index[i]+"' />";
	document.write(img_contact);
}
document.write("<p id='last'></p>");
$(document).ready(function(){
	$(window).scroll(function() {
	    if(document.body.scrollTop + document.body.clientHeight > document.body.scrollHeight / 10 ){
		if(j == friends_index.length ){
			return;
		}
		for(i = friends_index.length -1 -j ; i >= 0;i--){
			if( friends_index.length -1- i < j * 2){
				$("p#last").append( "<img src='"+server_address + "/tom/res/img/"+friends_index[i]+".jpg' width='80' height='120' id='"+friends_index[i]+"' />");
			}else{
				break;
			}
		}
		j = friends_index.length  -1- i;
		$(document).ready(function(){
			$("div#mark img").click(function(){
				window.lemon.js2client(2,"friends_detail.html?_id="+this.id+"&user_id="+user_id);
			});
		});
		}
	});
});
document.write("</div>");




</script>
</body>
</html>